/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package administracionDeMemoria;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import org.netbeans.lib.awtextra.AbsoluteConstraints;
import org.netbeans.lib.awtextra.AbsoluteLayout;

/**
 *
 * @author Administrador
 */
public class VentanaParametrosDiscoDuro extends javax.swing.JDialog
{

  /**
   * Creates new form VentanaParametrosDiscoDuro
   */
  public VentanaParametrosDiscoDuro(java.awt.Frame parent, boolean modal)
  {
    super(parent, modal);
    initComponents();
  }

  /**
   * This method is called from within the constructor to initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is always
   * regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new JPanel();
        txfNombre = new JTextField();
        jLabel1 = new JLabel();
        jLabel2 = new JLabel();
        txfSize = new JTextField();
        btnCrear = new JButton();

        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBackground(new Color(102, 153, 255));
        jPanel1.setLayout(new AbsoluteLayout());

        txfNombre.setText("Disco Duro");
        jPanel1.add(txfNombre, new AbsoluteConstraints(90, 20, 70, -1));

        jLabel1.setText("NOMBRE:");
        jPanel1.add(jLabel1, new AbsoluteConstraints(19, 24, -1, -1));

        jLabel2.setText("TAMAÑO:");
        jPanel1.add(jLabel2, new AbsoluteConstraints(20, 50, -1, -1));

        txfSize.setText("10240");
        jPanel1.add(txfSize, new AbsoluteConstraints(90, 50, 70, -1));

        btnCrear.setText("CREAR");
        btnCrear.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                btnCrearActionPerformed(evt);
            }
        });
        jPanel1.add(btnCrear, new AbsoluteConstraints(90, 110, -1, -1));

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btnCrearActionPerformed(ActionEvent evt) {//GEN-FIRST:event_btnCrearActionPerformed
DiscoDuro dd = new DiscoDuro(txfNombre.getText(),Integer.parseInt(txfSize.getText()));
arregloDisco.add(dd);
dispose();
}//GEN-LAST:event_btnCrearActionPerformed

    public ArrayList<DiscoDuro> getArregloDisco() {
        return arregloDisco;
    }

   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private JButton btnCrear;
    private JLabel jLabel1;
    private JLabel jLabel2;
    private JPanel jPanel1;
    private JTextField txfNombre;
    private JTextField txfSize;
    // End of variables declaration//GEN-END:variables
private ArrayList<DiscoDuro> arregloDisco=new ArrayList<DiscoDuro>();

}
